#!/bin/sh

#--------------------------------------------------------------------
# Performance and maintenance Utilities
#--------------------------------------------------------------------

case "$fn" in

    # See memory usage sorted by memory consumption
    "memory")

        if [ "$echocommand" == "true" ]; then
            echo "${GREEN}top -o MEM \n\n${NC}"
        fi
        top -o MEM
    ;;


    # Empty trash
    "trash:empty")

        if [ "$echocommand" == "true" ]; then
            echo "${GREEN}sudo rm -rf ~/.Trash/* \n\n${NC}"
        fi
        sudo rm -rf ~/.Trash/*
    ;;


    # Calculate trash size
    "trash:size")

        if [ "$echocommand" == "true" ]; then
            echo "${GREEN}du -sh ~/.Trash/ \n\n${NC}"
        fi
        echo "Trash size: "
        du -sh ~/.Trash/
    ;;

esac